package patrol.mobile.com.mobilepatrol.activity.security.emergency;

import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;

import com.dl7.recycler.helper.RecyclerViewHelper;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.OnClick;
import patrol.mobile.com.mobilepatrol.R;
import patrol.mobile.com.mobilepatrol.activity.BaseActivity;
import patrol.mobile.com.mobilepatrol.activity.security.ConsTitles;
import patrol.mobile.com.mobilepatrol.activity.security.adapter.EmergencyMediaAdapter;
import patrol.mobile.com.mobilepatrol.utils.CommonUtil;
import patrol.mobile.com.mobilepatrol.widget.MySpinner;

/**
 * Created by fuzhen.li on 2018/9/18.
 */
public class EmergencySaveThingsDeal2Activity extends BaseActivity {

    @BindView(R.id.recyclerView1)
    RecyclerView recyclerView1;
    @BindView(R.id.recyclerView2)
    RecyclerView recyclerView2;
    @BindView(R.id.spCheckType1)
    MySpinner spCheckType1;
    @BindView(R.id.spCheckType2)
    MySpinner spCheckType2;
    @BindView(R.id.tv_save)
    TextView tvSave;
    private EmergencyMediaAdapter emergencyMediaAdapter;

    @Override
    protected int attachLayoutRes() {
        return R.layout.activity_emergency_save_things_deal2;
    }

    @Override
    public void setListener() {
        List<String> list = new ArrayList<>();
        for (int i = 0; i < 5; i++) {
            list.add("123");
        }
        emergencyMediaAdapter = new EmergencyMediaAdapter(this, list);

        RecyclerViewHelper.initRecyclerViewH(this, recyclerView1, false, emergencyMediaAdapter);
        RecyclerViewHelper.initRecyclerViewH(this, recyclerView2, false, emergencyMediaAdapter);

        spCheckType1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                spCheckType1.setOnItemSelectedListener();
            }
        });
        spCheckType2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                spCheckType2.setOnItemSelectedListener();
            }
        });
    }


    @Override
    public void initData() {
        super.initData();

        List<String> strings = new ArrayList<>();
        strings.add("处理中");
        strings.add("已完结");
        spCheckType1.setmDatas(strings);
        spCheckType2.setmDatas(strings);

    }

    @Override
    public void initTitle() {
        iv_back.setImageResource(R.mipmap.up_white);
        iv_back.setVisibility(View.VISIBLE);
        iv_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                CommonUtil.exitActivityAndBackAnim(EmergencySaveThingsDeal2Activity.this, true);
            }
        });
        tv_center_title.setVisibility(View.VISIBLE);
        tv_center_title.setText(ConsTitles.EMERGENCY_SAVE_THINGS_DEAL_2);
    }

    @OnClick({R.id.tv_save})
    public void onTVClick(View v){

        switch(v.getId()){

            case R.id.tv_save:
                startActivity(EmergencySaveThingsDeal3Activity.class);
                break;

        }

    }


}
